package domain;

import java.util.Date;

public class Withdrawl {
    private Account account;  //账户
    private double amount;  //金额
    private Date date;  //时间

    public Withdrawl(Account account){
        this.account = account;
        this.date = new Date();
    }

    public Withdrawl(Withdrawl withdrawl,double amount){
        this.account = withdrawl.getAccount();
        this.date = withdrawl.getDate();
        this.amount = amount;
    }
    //取款
    public boolean withdrawl(double amount){
         return  AccountService.withdrawl(account, amount);
    }
    public Account getAccount() {
        return account;
    }
    public double getAmount() {
        return amount;
    }

    public Date getDate() {
        return date;
    }


}
